package com.atguigu.cloud.config;

import feign.Logger;
import feign.Retryer;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 重试机制，默认关闭
 *
 */
@Configuration
public class FeignConfig {


    @Bean
    public Retryer myRetryer(){

        //最大请求次数为3(1+2)，初始间隔时间为100ms，重试间最大间隔时间为1s
        //return new Retryer.Default(100,1,3)
        return  new Retryer.Default();

    }

    //总共有四个日志级别
    @Bean
    Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }


}
